import RouteView from '@/components/layouts/RouteView';
import Login from '@/views/user/Login';
var loginpath = Login
/**
 * 走菜单，走权限控制
 * @type {[null,null]}
 */


export const asyncRouterMap = [

  {
    path: '/',
    name: 'dashboard',
    // component: TabLayout,
    meta: {
      title: '首页'
    },
    redirect: '/dashboard/analysis',
    children: [
      // // dashboard
      // {
      //   path: '/dashboard',
      //   name: 'dashboard',
      //   redirect: '/dashboard/workplace',
      //   component: RouteView,
      //   meta: { title: '仪表盘', icon: 'dashboard', permission: [ 'dashboard' ] },
      //   children: [
      //     {
      //       path: '/dashboard/analysis',
      //       name: 'Analysis',
      //       component: () => import('@/views/dashboard/Analysis'),
      //       meta: { title: '分析页', permission: [ 'dashboard' ] }
      //     },
      //     {
      //       path: '/dashboard/monitor',
      //       name: 'Monitor',
      //       hidden: true,
      //       component: () => import('@/views/dashboard/Monitor'),
      //       meta: { title: '监控页', permission: [ 'dashboard' ] }
      //     },
      //     {
      //       path: '/dashboard/workplace',
      //       name: 'Workplace',
      //       component: () => import('@/views/dashboard/Workplace'),
      //       meta: { title: '工作台', permission: [ 'dashboard' ] }
      //     }
      //   ]
      // },
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]


// console.log('process', loginpath)

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  // easyWork
  {
    path: "/OAuth2LoginEasyWork/easyLogin",
    name: "easyLogin",
    component: () => import("@/views/user/third/OAuth2LoginEasyWork"),
    meta: {
      title: "正在授权登陆...",
      keepAlive: false,
    },
  },

  {
    path: '/user',
    // component: UserLayout,
    redirect: '/user/login',
    // hidden: true,
    component: RouteView,
    children: [{
      path: 'login',
      name: 'login',
      // component: Login,
      component: loginpath
    }
    ]
  },
  {
    path: '/application',
    name: 'application',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/applicationModule/application'),
    meta: {
      title: '应用',
      keepAlive: false
    }
  },
  {
    path: '/initiateApplication',
    name: 'initiateApplication',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/scanCodeModule/scanCode'),
    meta: {
      title: '扫码',
      keepAlive: false
    }
  },
  {
    path: '/report',
    name: 'report',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/report/index'),
    meta: {
      title: '报表',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/stockCheckDetail',
    name: 'stockCheckDetail',
    component: () => import('@/views/warehouseManagement/stockCheck/stockCheckDetail.vue'),
    meta: {
      title: '库存盘点详情',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/mine/mine'),
    meta: {
      title: '我的',
      keepAlive: false
    }
  },
  {
    path: '/consult',
    name: 'consult',
    component: () => import('@/views/mine/consult'),
    meta: {
      title: '业务咨询',
      keepAlive: false
    }
  },
  {
    path: '/feedback',
    name: 'feedback',
    component: () => import('@/views/mine/feedback'),
    meta: {
      title: '意见反馈',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/productBatchReport',
    name: 'productBatchReport',
    component: () => import('@/views/workManagement/productTask/productBatchReport.vue'),
    meta: {
      title: '批量报工',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/qualityBatchReport',
    name: 'qualityBatchReport',
    component: () => import('@/views/qualityManagement/qualityTask/qualityBatchReport.vue'),
    meta: {
      title: '质检批量报工',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/addWarehouse',
    name: 'addWarehouse',
    component: () => import('@/views/warehouseManagement/warehouse/addWarehouse.vue'),
    meta: {
      title: '新建仓库',
      keepAlive: false,
      appId: '0a8a9c9ed1124b85ac44fc4625226f1b'
    }
  },
  {
    path: '/demo',
    name: 'demo',
    component: () => import('@/views/dashboard/demo'),
    meta: { title: '列表测试', keepAlive: false }
  },
  {
    path: '/demo1',
    name: 'demo1',
    component: () => import('@/views/dashboard/demo1'),
    meta: { title: '流程测试', keepAlive: false }
  },
  {
    path: '/demo2',
    name: 'demo2',
    component: () => import('@/views/dashboard/demo2'),
    meta: { title: '列表选择', keepAlive: false }
  },
  {
    path: '/warehouseManagement/stockAllocation/stockAllocationDetail',
    name: 'stockAllocationDetail',
    component: () => import('@/views/warehouseManagement/stockAllocation/stockAllocationDetail.vue'),
    meta: { title: '调拨单详情', keepAlive: false }
  },
  {
    path: '/workManagement/workOrder/workOrderListDetail',
    name: 'workOrderListDetail',
    component: () => import('@/views/workManagement/workOrder/workOrderListDetail.vue'),
    meta: { title: '工单详情', keepAlive: false }
  },
  {
    path: '/salesContractDetails',
    name: 'salesContractDetails',
    component: () => import('@/views/salesManagement/salesContract/salesContractDetails.vue'),
    meta: { title: '生产订单详情', keepAlive: false }
  },
  {
    path: '/changePassWords',
    name: 'changePassWords',
    component: () => import('@/views/mine/changePassWords'),
    meta: {
      title: '修改密码',
      keepAlive: false,
    }
  },
  {
    path: '/aboutUs',
    name: 'aboutUs',
    component: () => import('@/views/mine/aboutUs'),
    meta: {
      title: '关于我们',
      keepAlive: false,
    }
  },
]
